package me.ywd.ribbon.config;

import com.netflix.loadbalancer.*;
import me.ywd.ribbon.common.ExcludeAnnotation;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author Ye_Wenda
 * @Date 9/15/2017
 */
@Configuration
@ExcludeAnnotation
public class ProviderConfiguration {
//
//    // 流产了，塞不进去
////    @Bean
//    public ServerList<Server> ribbonServerList() {
//        ServerList<Server> servers = new ConfigurationBasedServerList();
//        Server server1 = new Server("localhost", 1010);
//        Server server2 = new Server("localhost", 1011);
//        return servers;
//    }

    @Bean
    public IRule ribbonRule() {
        return new RandomRule();
    }

}
